using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RapidHDL
{
    public partial class FDelay : Form
    {
        int iTicks = 0;

        public FDelay()
        {
            InitializeComponent();
        }

        private void FDelay_Load(object sender, EventArgs e)
        {

        }

        public void SetupDelay(double pdblSeconds, string psCaption, string psLabel)
        {
            this.Text = psCaption;
            lblWait.Text = psLabel;
            double dblInterval = pdblSeconds / 100 * 1000;
            tmrWait.Interval = (int)dblInterval;
            tmrWait.Enabled = true;
        }

        private void tmrWait_Tick(object sender, EventArgs e)
        {
            iTicks++;
            if (iTicks >= 100)
            {
                tmrWait.Enabled = false;
                this.Close();
                return;
            }
            pbWait.Value = iTicks;
        }

        private void pbWait_Click(object sender, EventArgs e)
        {

        }
    }
}